package com.zhima.util;

import com.zhima.dto.UserDTO;

public class UserHolder {
    private static final ThreadLocal<UserDTO> SAFE_USER_DTO = new ThreadLocal<>();

    public static void saveUser(UserDTO userDTO) {
        SAFE_USER_DTO.set(userDTO);
    }

    public static UserDTO get() {
        return SAFE_USER_DTO.get();
    }

    public static void removeUser() {
        SAFE_USER_DTO.remove();
    }
}
